/**
 * @param {number} n
 * @return {number}
 */
 var cuttingRope = function(n) {
    let res=0n,bign=BigInt(n);
    for(let i=2n;i<=bign;i++){
        let newrs=max(bign,i);
        res=newrs>res?newrs:res;
    }
    return res%(1000000007n);
    function max(num,count){
        let a=num/count,b=num%count;
        return (a**(count-b))*(b==0n?1n:((a+1n)**b));
    }
};